import request from '../request'

const Api = {
  page: '/api/admincourseCode/courseCode/page',
  update: '/api/admincourseCode/courseCode/update',
  schoolPage: '/api/adminschool/school/page',
  remove: '/api/admincourseCode/courseCode/remove',
  save: '/api/admincourseCode/courseCode/save',
  details: '/api/admincourseCode/courseCode/selectById',
  coursePage: '/api/admincourseBasicInformation/courseBasicInformation/page',
  tree: '/api/admindisciplineCategory/disciplineCategory/tree',
  dictionary: '/api/sys/dict/data/getList'
}

export const remove = params => {
  return request.request({
    url: Api.remove,
    params,
    method: 'DELETE'
  })
}
// 课程代码的分页
export const page = params => {
  return request.request({
    url: Api.page,
    params,
    method: 'GET'
  })
}
// 学科类别
export const tree = params => {
  return request.request({
    url: Api.tree,
    params,
    method: 'GET'
  })
}
// 获取学校分页
export const schoolPage = params => {
  return request.request({
    url: Api.schoolPage,
    params,
    method: 'GET'
  })
}

/** 课程代码管理基本信息 */
export const save = data => {
  return request.request({
    url: Api.save,
    data,
    method: 'POST'
  })
}

/** 课程代码管理基本信息 */
export const update = data => {
  return request.request({
    url: Api.update,
    data,
    method: 'put'
  })
}

/** 课程代码管理基本信息 */
export const details = params => {
  return request.request({
    url: Api.details,
    params,
    method: 'GET'
  })
}
/** 课程基本信息列表 */
export const coursePage = params => {
  return request.request({
    url: Api.coursePage,
    params,
    method: 'GET'
  })
}
/** 数据字典列表 */
export const dictionary = params => {
  return request.request({
    url: Api.dictionary,
    params,
    method: 'GET'
  })
}
